clear all

cd "/Users/nicolaspolasek/Documents/Career/Education/PhD/ Berkeley ARE/Courses/ Spring 2023/ECON 270B/Replication Exercise/Replication data for Bustos et al. 2016/APST_ReplicationFiles"

use APST_AMC, replace



* Impact of GE soy adoption on employment share in manufacturing
* 2SLS w/o all controls
ivregress 2sls dLm_L  l4.rural_adult  	(l1.dgsoy_TA_w	= dA_soy)			if year == 2010 & rf == 1 , r

* 2SLS with all controls
ivregress 2sls dLm_L  l4.rural_adult  l4.log_y_pc_r l4.log_pop_area l4.alpha_adult	(l1.dgsoy_TA_w	= dA_soy)			if year == 2010 & rf == 1 , r


* Impact of GE soy adoption on employment levels in manufacturing
* 2SLS w/o all controls
ivregress 2sls dlog_Lm  l4.rural_adult  	(l1.dgsoy_TA_w	= dA_soy)			if year == 2010 & rf == 1 , r

* 2SLS with all controls
ivregress 2sls dlog_Lm  l4.rural_adult  l4.log_y_pc_r l4.log_pop_area l4.alpha_adult	(l1.dgsoy_TA_w	= dA_soy)			if year == 2010 & rf == 1 , r




* Impact of soy and maize adoption on employment share in manufacturing
* 2SLS w/o all controls
ivregress 2sls dLm_L  l4.rural_adult  	(l1.dsoy_TA_w l1.dmze_TA_w = dA_soy dA_mze)			if year == 2010 & rf == 1 , r


* 2SLS with all controls
ivregress 2sls dLm_L  l4.rural_adult  l4.log_y_pc_r l4.log_pop_area l4.alpha_adult	(l1.dsoy_TA_w l1.dmze_TA_w = dA_soy dA_mze)			if year == 2010 & rf == 1 , r



* Impact of soy and maize adoption on employment levels in manufacturing
* 2SLS w/o all controls
ivregress 2sls dlog_Lm  l4.rural_adult  	(l1.dsoy_TA_w l1.dmze_TA_w = dA_soy dA_mze)			if year == 2010 & rf == 1 , r


* 2SLS with all controls
ivregress 2sls dlog_Lm  l4.rural_adult  l4.log_y_pc_r l4.log_pop_area l4.alpha_adult	(l1.dsoy_TA_w l1.dmze_TA_w = dA_soy dA_mze)			if year == 2010 & rf == 1 , r


* Impact of soy and maize adoption on log wages
* 2SLS w/o all controls
ivregress 2sls dlog_ym  l4.rural_adult  	(l1.dsoy_TA_w l1.dmze_TA_w = dA_soy dA_mze)			if year == 2010 & rf == 1 , r


* 2SLS with all controls
ivregress 2sls dlog_ym  l4.rural_adult  l4.log_y_pc_r l4.log_pop_area l4.alpha_adult	(l1.dsoy_TA_w l1.dmze_TA_w = dA_soy dA_mze)			if year == 2010 & rf == 1 , r


********************************************************************************
************************** Table: First Stages *********************************
********************************************************************************
reg l1.dgsoy_TA_w dA_soy l4.rural_adult if year == 2010 & rf == 1 , r
	outreg2 using Tables\Table_robustness_first_stage, ctitle("Change in GE soy area share") dec(3) addstat(F test: , e(F)) nocons replace

reg l1.dgsoy_TA_w dA_soy l4.rural_adult l4.log_y_pc_r l4.log_pop_area l4.alpha_adult if year == 2010 & rf == 1 , r
	outreg2 using Tables\Table_robustness_first_stage, ctitle(" ") dec(3) addstat(F test: , e(F)) nocons append

reg l1.dsoy_TA_w dA_soy dA_mze l4.rural_adult l4.log_y_pc_r l4.log_pop_area l4.alpha_adult if year == 2010 & rf == 1 , r
	outreg2 using Tables\Table_robustness_first_stage, ctitle("Change in GE soy area share") dec(3) addstat(F test: , e(F)) nocons append

reg l1.dmze_TA_w dA_soy dA_mze l4.rural_adult l4.log_y_pc_r l4.log_pop_area l4.alpha_adult if year == 2010 & rf == 1 , r
	outreg2 using Tables\Table_robustness_first_stage, ctitle(" ") dec(3) addstat(F test: , e(F)) nocons append excel 


	
********************************************************************************
************************** Table: Second Stages ********************************
********************************************************************************

******  GE Soy **********
* Impact of GE soy adoption on employment share in manufacturing
ivregress 2sls dLm_L  l4.rural_adult  	(l1.dgsoy_TA_w	= dA_soy)			if year == 2010 & rf == 1 , r
	outreg2 using Tables\Table_GEsoy, ctitle("Change in Employment share (2010-2000)") dec(3) nocons replace
ivregress 2sls dLm_L  l4.rural_adult  l4.log_y_pc_r l4.log_pop_area l4.alpha_adult	(l1.dgsoy_TA_w	= dA_soy)			if year == 2010 & rf == 1 , r
	outreg2 using Tables\Table_GEsoy, ctitle(" ") dec(3) nocons append

* Impact of GE soy adoption on employment levels in manufacturing
ivregress 2sls dlog_Lm  l4.rural_adult  	(l1.dgsoy_TA_w	= dA_soy)			if year == 2010 & rf == 1 , r
	outreg2 using Tables\Table_GEsoy, ctitle("Change in log Employment (2010-2000)") dec(3) nocons append
ivregress 2sls dlog_Lm  l4.rural_adult  l4.log_y_pc_r l4.log_pop_area l4.alpha_adult	(l1.dgsoy_TA_w	= dA_soy)			if year == 2010 & rf == 1 , r
	outreg2 using Tables\Table_GEsoy, ctitle(" ") dec(3) nocons append
	
* Impact of GE soy adoption on employment levels on log wages
ivregress 2sls dlog_ym  l4.rural_adult  	(l1.dgsoy_TA_w	= dA_soy)			if year == 2010 & rf == 1 , r
	outreg2 using Tables\Table_GEsoy, ctitle("Change in log wage (2010-2000)") dec(3) nocons append
ivregress 2sls dlog_ym  l4.rural_adult  l4.log_y_pc_r l4.log_pop_area l4.alpha_adult	(l1.dgsoy_TA_w	= dA_soy)			if year == 2010 & rf == 1 , r
	outreg2 using Tables\Table_GEsoy, ctitle(" ") dec(3) nocons append excel

********************************************************************************
	
****** Soy and maize **********
* Impact of soy and maize adoption on employment share in manufacturing
ivregress 2sls dLm_L  l4.rural_adult  	(l1.dsoy_TA_w l1.dmze_TA_w = dA_soy dA_mze)			if year == 2010 & rf == 1 , r
	outreg2 using Tables\Table_soy_maize, ctitle("Change in Employment share (2010-2000)") dec(3) nocons replace
ivregress 2sls dLm_L  l4.rural_adult  l4.log_y_pc_r l4.log_pop_area l4.alpha_adult	(l1.dsoy_TA_w l1.dmze_TA_w = dA_soy dA_mze)			if year == 2010 & rf == 1 , r
	outreg2 using Tables\Table_soy_maize, ctitle(" ") dec(3) nocons append

* Impact of soy and maize adoption on employment levels in manufacturing
ivregress 2sls dlog_Lm  l4.rural_adult  	(l1.dsoy_TA_w l1.dmze_TA_w = dA_soy dA_mze)			if year == 2010 & rf == 1 , r
	outreg2 using Tables\Table_soy_maize, ctitle("Change in log Employment (2010-2000)") dec(3) nocons append
ivregress 2sls dlog_Lm  l4.rural_adult  l4.log_y_pc_r l4.log_pop_area l4.alpha_adult	(l1.dsoy_TA_w l1.dmze_TA_w = dA_soy dA_mze)			if year == 2010 & rf == 1 , r
	outreg2 using Tables\Table_soy_maize, ctitle(" ") dec(3) nocons append

* Impact of soy and maize adoption on log wages
ivregress 2sls dlog_ym  l4.rural_adult  	(l1.dsoy_TA_w l1.dmze_TA_w = dA_soy dA_mze)			if year == 2010 & rf == 1 , r
	outreg2 using Tables\Table_soy_maize, ctitle("Change in log wage (2010-2000)") dec(3) nocons append
ivregress 2sls dlog_ym  l4.rural_adult  l4.log_y_pc_r l4.log_pop_area l4.alpha_adult	(l1.dsoy_TA_w l1.dmze_TA_w = dA_soy dA_mze)			if year == 2010 & rf == 1 , r
	outreg2 using Tables\Table_soy_maize, ctitle(" ") dec(3) nocons append excel

